<?php

class Blog_Widget_Browse_Profile_Index extends Nuo_Widget
{
	function execute()
	{
		$table = Nuo::getTable('blog/post');

		$mainResource = Nuo::getVar('mainResource');

		$select = $table -> select() 
		-> from(array('m' => $table -> getName())) 
		-> where('resource_id=?', $mainResource -> getItemId()) -> order('created_at DESC');

		$paging = Nuo_Paging::factory($select);

		return $this -> render(array(
			'paging' => $paging,
			'resource' => $mainResource
		));
	}

}
